package com.lantosec.hmrp.modules.category.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsCheckDetailedVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 盘点计划明细 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-01
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsCheckDetailed extends BaseEntity<AssetsCheckDetailedVO> {

    private static final long serialVersionUID = 1L;
    public AssetsCheckDetailed(AssetsCheckDetailedVO vo){
        this.detailedId = vo.getDetailedId();
        this.planId = vo.getPlanId();
        this.areaId = vo.getAreaId();
        this.areaName = vo.getAreaName();
        this.deptId = vo.getDeptId();
        this.deptName = vo.getDeptName();
        this.checkUserId = vo.getCheckUserId();
        this.checkUser = vo.getCheckUser();
        this.schedule = vo.getSchedule();
        this.assetsCount = vo.getAssetsCount();
        this.checkCount = vo.getCheckCount();
    }

    @Override
    public AssetsCheckDetailedVO convertToVO(){
        return new AssetsCheckDetailedVO(this);
    }


    /**
     * 盘点明细ID
     */
    @TableId(value = "detailed_id", type = IdType.AUTO)
    private Integer detailedId;

    /**
     * 计划ID
     */
    private String planId;

    /**
     * 资产所属区域ID
     */
    private String areaId;

    /**
     * 资产所属区域名称
     */
    private String areaName;

    /**
     * 资产使用部门ID
     */
    private String deptId;

    /**
     * 资产使用部门名称
     */
    private String deptName;

    /**
     * 盘点人ID
     */
    private String checkUserId;

    /**
     * 盘点人
     */
    private String checkUser;

    //进度
    @TableField(exist = false)
    private Double schedule;

    @TableField(exist = false)
    private Integer assetsCount;

    @TableField(exist = false)
    private Integer checkCount;


    public enum ColName {
        detailed_id, plan_id, area_id, area_name, dept_id, dept_name, check_user_id, check_user, 
    }
}
